package timing.ukulele.portal.convertor;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;
import timing.ukulele.common.data.BaseDataConverter;
import timing.ukulele.data.portal.view.SysParamVO;
import timing.ukulele.portal.persistent.SysParam;

@Mapper
public interface ParamConvertor extends BaseDataConverter<SysParam, SysParamVO> {
    ParamConvertor INSTANCE = Mappers.getMapper(ParamConvertor.class);

    @Override
    @Mappings({
            @Mapping(target = "createBy", ignore = true),
            @Mapping(target = "updateBy", ignore = true),
    })
    SysParam v2p(SysParamVO sysParamVO);

    @Override
    @Mappings({
            @Mapping(target = "typeDescription", ignore = true)
    })
    SysParamVO p2v(SysParam sysParam);
}
